const Router = require('koa-router')
const { savePageView, getOnePagePv, getAuthorPv, getDateAuthorPv, getDateArticlePv
    , saveLiked, getOneArticleLiked, saveCollect, getArticleCollect, cancelArticleCollect, getPvSum, articleCount, getCollectList, getAllArticleLiked,getWordCloud } = require('../controller/analyse.controller')

const router = new Router({ prefix: '/analyse' })


// pv埋点
router.post('/savePageView', savePageView)
// 查询单篇文章pv
router.get('/getOnePagePv', getOnePagePv)
// 作者的所有文章pv
router.get('/getAuthorPv', getAuthorPv)
// 作者近 7，15，30日的pv
router.get('/getDateAuthorPv', getDateAuthorPv)
// 文章近 7,15,30日的PV
router.get('/getDateArticlePv', getDateArticlePv)
// pvSum
router.get('/getPvSum', getPvSum)

// 点赞
router.post('/saveLiked', saveLiked)
// 单篇文章点赞查询
router.get('/getOneArticleLiked', getOneArticleLiked)
//  作者点赞量查询
router.get('/getAllArticleLiked', getAllArticleLiked)

// 收藏
router.post('/saveCollect', saveCollect)
// 单篇文章的收藏
router.get('/getArticleCollect', getArticleCollect)
// 我收藏
router.get('/getCollectList', getCollectList)
// 取消收藏
router.post('/cancelArticleCollect', cancelArticleCollect)


// 文章分类统计
router.get('/articleCount', articleCount)
// 关键字搜索词云图
router.get('/getWordCloud', getWordCloud)
// 导出
module.exports = router